<?php
//王晓梦
declare (strict_remarkss=1);

namespace app\backend\validate;

use think\Validate;

class CooperationValidate extends Validate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id' => 'require',
        'cate_id' => 'require',
        'remarks' => 'require',
        'introduce' => 'require',
        'requirement' => 'require',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require' => 'id不能为空！',
        'cate_id.require' => '请选择分类！',
        'introduce.require' => '请输入业务介绍！',
        'requirement.require' => '请输入业务要求！',
        'remarks.require' => '请输入备注',

    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'save' => ['cate_id', 'introduce', 'requirement','remarks'],
        'update' => ['id', 'cate_id', 'introduce','requirement','remarks']
    ];
}
